<?php

namespace app\adminapi\export;

use app\services\product\BrandService;
use app\services\product\product\StoreProductServices;

class StoreProductBrandExport extends BaseExport
{
    protected $header = [
        '品牌ID', '品牌名称', '品牌简介'
    ];

    public function createData(array $where)
    {

        $list = app()->make(BrandService::class)->getList($where)['list'];

        $data = [];

        foreach ($list as $item) {
            $data[] = [
                $item['id'] ?? '',
                $item['name'] ?? '',
                $item['description'] ?? ''
            ];
        }

        return $data;
    }
}